<template>
  <div>
    <Header :active="5"/>
    <div class="news-content">
      <div class="banner">
        <img style="width: 100%" src="../../static/image/news-banner.png">
      </div>





      <!--新闻列表-->
      <div   class="news-list">
        <div class="common-width desc">
          <div class="el-row">
            <ul>
              <li v-for=" items in news">
                <div class="item">
                  <div class="fl photo"><img :src="items.photo"></div>
                  <div class="fr introduction">
                    <div class="fl">
                      <div class="title-label"><a @click="goMore(items.id)">{{items.title}}</a></div>
                      <div class="intro-label" >
                        {{items.description}}
                      </div>
                    </div>
                    <div class="fr time">
                      <div>{{ dateFormat(items.gmtCreate,'yyyy-MM-dd ')}}</div>
                      <div>
                        <el-button @click="goMore(items.id)">more<i class="el-icon-arrow-right el-icon--right"></i></el-button>
                      </div>
                    </div>
                  </div>

                </div>
              </li>



            </ul>
          </div>
        </div>
      </div>




    </div>
    <Footer/>
  </div>
</template>
<script>

  import Header from '@/components/Header'
  import Footer from '@/components/Footer'
  import {formatDate} from '@/utils/global'
  export default {
    components: {Header, Footer},
    filters: {},
    data() {
      return {
        teamWidth: 0,
        news: [],
      }
    },
    mounted() {


    },
    watch: {
      "$route": "reload"    //后面是methods中的一个方法
    },
    created() {
      this.teamWidth = 1190 - 266 - 121-134-182;
      let _self = this;
      _self.$store.dispatch('news', {}).then(response => {
        this.news = response.data;
      }).catch(() => {
      })
    },
    methods: {
      goMore(id){
        this.$router.push({ path:'/news/'+id+''  })
      },
      fetchData() {

        let _self = this;
        _self.$store.dispatch('statisticsProjectStatus', {}).then(response => {
          _self.list = response.data;
          _self.total = response.count;
        }).catch(() => {
        })
      },
      dateFormat(d, fmt) {
        return formatDate(d, fmt);
      }
    }
  }

</script>
<style>

</style>
